<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<%@ include file="/pub/head.inc"%>
    <title>Node list</title>
</head>
<body>
  	<!-- Search Form -->
  	<div id="mainsearch" style=" width:98%">
	    <div class="searchtitle">
	        <span>搜索</span><img src="${baseURL}/themes/default/icons/32X32/searchtool.gif" />
	        <div class="togglebtn"></div> 
	    </div>
	    <div class="navline" style="margin-bottom:4px; margin-top:4px;"></div>
	    <div class="searchbox">
	        <form id="formsearch" class="l-form" method="get">
	        	<table>
					<tr>
						<td align="right" class="l-table-edit-td">${field.beanFieldDesc}</td>
						<td align="left" class="l-table-edit-td" style="width: 160px">
							<input  name="${field.beanFieldName}" type="text" ltype="${field.pageBeanFieldType}" class="field" />
						</td>
						<td align="left" class="l-table-edit-td">
							<button type="button" id="btnSearch" class="l-button l-button-submit"><i class="fa fa-search"></i> 搜索</button>
						</td>
						<td align="left" class="l-table-edit-td">
							<button type="reset" id="btnReset" class="l-button l-button-test" ><i class="fa fa-exchange"></i> 重置</button>
						</td>
					</tr>
				</table>
	        </form>
	    </div>
  	</div>
  	<!-- Search Form end -->
 	<!-- Grid List-->
	<div id="maingrid"></div> 
	<!-- Grid List end-->
  	<script type="text/javascript">
  		var baseUrl = '${baseURL}/node/node';

		//列表渲染
      	var grid = $("#maingrid").ligerGrid({ 
          	columns: [
				{display:"节点名称",name:"portNodeName",width:150,type:"text",align:"left",isSort : true},
				{display:"视频数量",name:"videoCount",width:150,type:"text",align:"left",isSort : true},
				{display:"播放次数",name:"playCount",width:150,type:"text",align:"left",isSort : true},
				{display:"发布时间",name:"createTime",width:150,type:"date",align:"left",isSort : true}
   		  	],
          	dataAction: 'server',toolbar: {},
          	url:  baseUrl+'list/listJSON.do',
          	width: '98%', height: '100%',heightDiff:-10, checkbox: true,
          	pageParmName:"pageNo",pageSizeOptions:[${pageOptions}],pagesizeParmName:"perPageSize",
          	rowHeight:23,rownumbers:true,isScroll:true,sortnameParmName:"sortName",
          	sortorderParmName:"sortOrder",checkbox:true,pageSize: ${pageSize}
      	});
      	//搜索表单渲染
		$("#formsearch").ligerForm();
		
      	//加载工具栏

		//双击事件
      	LG.setGridDoubleClick(grid, FF_ModifyClickEvent);
      	
	  	//搜索事件
      	$("#btnSearch").click(function(e){
    	  	var json = LG.bulidFilterParams($("#formsearch"));
          	grid.set('parms', json);
            //采用原来的请求地址，带上参数加载数据
		  	grid.loadData();
      	});
      	
  	   	//重置事件
     	$("#btnReset").click(function(e){
        	grid.set('parms', null);
            //采用原来的请求地址，带上参数加载数据
			grid.loadData();
      	});
	  
      
  	</script>
</body>
</html>